<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>变量的定义</title>
    <script>
        function f1(){
            // 声明变量
            var name;
            console.log(name)
            // 为变量赋值
            name = "admin";
            // 声明变量的同时为变量赋值
            var age = 19;
            // let一般用于定义变量
            let id = 1;
            // const一般用于定义常量
            const gender = "男";
            // const gender = "女";
            // let name = "alice";
            var name = "alice";
        }
    </script>
</head>
<body>
<button onclick="f1()">定义变量</button>
</body>
</html>